<?php
namespace Opportunity\Model;

use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;
use Zend\Stdlib\Hydrator\ArraySerializable;

class Detail {

    public $id;
    public $name;
    public $amount;
	public $account;
    public $closedate;
    public $stage;
    public $probability;
	public $source;
	public $description;

    
	public function exchangeArray($data)
	{
		$this->id     = (isset($data['id'])) ? $data['id'] : null;
		$this->name = (isset($data['name'])) ? $data['name'] : null;
		$this->amount  = (isset($data['amount'])) ? $data['amount'] : null;
		$this->account  = (isset($data['account'])) ? $data['account'] : null;
		$this->closedate  = (isset($data['closedate'])) ? $data['closedate'] : null;
		$this->stage  = (isset($data['stage'])) ? $data['stage'] : null;
		$this->probability  = (isset($data['probability'])) ? $data['probability'] : null;
		$this->source  = (isset($data['source'])) ? $data['source'] : null;
		$this->description  = (isset($data['description'])) ? $data['description'] : null;
		
	}
	public function __construct(array $options = null) {
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}

	public function getArrayCopy()
	{
		return get_object_vars($this);
	}
	
	protected $inputFilter;
	
	public function setInputFilter(InputFilterInterface $inputFilter)
	{
		throw new \Exception("Not used");
	}
	public function getInputFilter()
	{
		if (!$this->inputFilter)
		{
			$inputFilter = new InputFilter();
			$factory = new InputFactory();
	
	
			$inputFilter->add($factory->createInput(array(
					'name' => '=name',
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
					 
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'amount',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
			
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'account',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'closedate',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'stage',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'probability',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'source',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			$inputFilter->add($factory->createInput(array(
					'name' => 'description',
					
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim'),
					),
						
			)));
			
			
			$this->inputFilter = $inputFilter;
			}
			
			return $this->inputFilter;
			}
	}
	?>